# -*- coding: utf-8 -*-
# @Time    : 2020/3/19 13:39
# @Author  : Weymouth
# @Email   : 261229090@qq.com
# @File    : json_test.py
# @Software: PyCharm
# ---------------------------------------------------

# dic = str({'111': '111111'})
# f = open('test', 'w')

#序列化
#我们把对象（变量）从内存中变成可存储或传输的过程称之为序列化

import json

# dic = {'name': 'abc', 'age': '18'}
# data = json.dumps(dic)
# f = open('JSON_text', 'w')
# f.write(data)
# f.close()

dic = {'name': 'abc', 'age': '18'}
f = open('JSON_text', 'w')

json.dump(dic, f)

f.close()
